#ifndef __PACKAGE_H__
#define __PACKAGE_H__


namespace SPlayer
{
    namespace Network
    {
        using namespace System;
        using namespace System::Net;
        using namespace System::Net::Sockets;
        using namespace System::Collections::Concurrent;
        using namespace System::Collections::Generic;

        ref class NetworkInfo
        {
        public:
            static const int port = 2015;
            static array<System::Net::IPAddress ^> ^hostAddresses = gcnew array<System::Net::IPAddress ^>(1)
            {
                System::Net::IPAddress::Parse("127.0.0.1")
            };
            static void addAddress(String ^address)
            {
                auto addr = System::Net::IPAddress::Parse(address);
                if (- 1 == Array::IndexOf(hostAddresses, addr))
                {
                    auto arr = gcnew array<System::Net::IPAddress ^>(hostAddresses->Length + 1);
                    hostAddresses->CopyTo(arr, 1);
                    arr[0] = addr;
                    delete hostAddresses;
                    hostAddresses = arr;
                }
            }
        };
    }
}

#endif // __PACKAGE_H__